**************************************************************************
** Polity.do								**
** Joseph Wright, josephgwright@gmail.com				**
** Date created: August 6, 2013						**
** Date updated: October 14, 2015					**
**									**
** Parent file: 							**
**     AutocraticInstability.do        					**
**									**
** Using data:								**
**     Polity.dta							**
**									**
**************************************************************************

use polity, clear
set scheme lean1
tsset cowcode year

egen caseid = group(gwf_case)

gen lag_POL_polity = l.POL_polity
gen lag_POL_polity2 = l.POL_polity2
gen lead_POL_polity = F.POL_polity
gen lead_POL_polity2 = F.POL_polity2

gen lag2_POL_polity = l2.POL_polity
gen lag2_POL_polity2 = l2.POL_polity2
gen lead2_POL_polity = F2.POL_polity
gen lead2_POL_polity2 = F2.POL_polity2

gen gwfregimetype = .
replace gwfregimetype = 1 if gwf_regime=="democracy" & gwf_regime~=""
replace gwfregimetype = 2 if gwf_regime~="democracy" & gwf_regime~=""
replace gwfregimetype = 3 if gwf_regime=="provisional" & gwf_regime~=""
replace gwfregimetype = 4 if gwf_regime=="warlord" & gwf_regime~=""
replace gwfregimetype = 5 if gwf_regime=="foreign-occupied" & gwf_regime~=""
replace gwfregimetype = 6 if gwf_regime=="warlord/foreign-occupied" & gwf_regime~=""
replace gwfregimetype = 7 if gwf_regime=="not-independent" & gwf_regime~=""
label define GWF_Regime_Type 1 "democracy" 2 "autocracy" 3 "provisional" 4 "warlord" 5 "foreign-occupied" 6 "warlord/foreign-occupied" 7 "not-independent"
label values gwfregimetype GWF_Regime_Type

gen gwfregimefail = .
replace gwfregimefail = 1 if gwf_fail==1 & gwf_fail~=. & ((F.gwfregimetype==3 & gwfregimetype==2) | (F.gwfregimetype==3 & gwfregimetype==4) | (F.gwfregimetype==1 & gwfregimetype==3) | (F.gwfregimetype==1 & gwfregimetype==2) | (F.gwfregimetype==1 & gwfregimetype==4) | (F.gwfregimetype==1 & gwfregimetype==5) | (F.gwfregimetype==1 & gwfregimetype==6) | (F.gwfregimetype==1 & gwfregimetype==7))
replace gwfregimefail = 2 if gwf_fail==1 & gwf_fail~=. & ((F.gwfregimetype==2 & gwfregimetype==2) | (F.gwfregimetype==2 & gwfregimetype==4) | (F.gwfregimetype==2 & gwfregimetype==5) | (F.gwfregimetype==2 & gwfregimetype==6) | (F.gwfregimetype==2 & gwfregimetype==7))  
replace gwfregimefail = 3 if gwf_fail==1 & ((F.gwfregimetype==2 & gwfregimetype==1) | (F.gwfregimetype==2 & gwfregimetype==3)) 
label define GWF_regimefail 1 "Democratic transition" 2 "Autocratic transition" 3 "Democratic failure" 
label values gwfregimefail GWF_regimefail

gen regimefail = .
replace regimefail = 0 if POL_fail~=.
replace regimefail = -88 if POL_polity==-66 | POL_polity==-77   /* foreign interruption and interregunum */
replace regimefail = -88 if l.POL_polity==.                     /* new countries with no prior polity score */
sort cow year

** Democratic Transitions
replace regimefail = 1 if POL_fail==1 & gwfregimefail==1
replace regimefail = 1 if POL_fail==1 & (F.gwfregimefail==1)  & gwf_fail==0 & caseid==F.caseid 
replace regimefail = 1 if POL_fail==1 & (F2.gwfregimefail==1)  & gwf_fail==0 & caseid==F2.caseid 
replace regimefail = 1 if POL_fail==1 & gwf_fail==1 & gwf_fail~=. & ((F.gwfregimetype==3 & gwfregimetype==2) | (F.gwfregimetype==1 & gwfregimetype==3) | (F.gwfregimetype==1 & gwfregimetype==2)) 
replace regimefail = 1 if POL_fail==1 & gwf_fail~=1 & gwf_fail~=. &  POL_polity>=6 & lag_POL_polity<6 & l.gwf_fail==1
replace regimefail = 1 if POL_fail==1 & gwf_fail~=1 & gwf_fail~=. & (F.regimefail==1 | F2.regimefail==1)
replace regimefail = 1 if POL_fail==1 & gwf_fail~=1 & L.POL_polity==-88 & L.gwfregimefail==1

** Autocratic transitions and consolidation
replace regimefail = 3 if POL_fail==1 & gwfregimefail==2  
replace regimefail = 3 if POL_fail==1 & gwf_fail~=1 & gwf_fail~=. &  (l.gwfregimefail==2 | l2.gwfregimefail==2) & POL_polity2<6 & POL_polity<lag_POL_polity
replace regimefail = 3 if POL_fail==1 & gwf_fail~=1 & gwf_fail~=. & POL_polity==-88 & regimefail~=1 & (F.regimefail==3 | F2.regimefail==3)   
replace regimefail = 3 if POL_fail==1 & gwf_fail~=1 & L.POL_polity==-88 & L.regimefail==3
replace regimefail = 3 if POL_fail==1 & gwf_fail~=1 & L.POL_polity==-88 & L.regimefail==3 & L2.regimefail==3

** Democratic failure
replace regimefail = 5 if POL_fail==1 & gwfregimefail==3
replace regimefail = 5 if POL_fail==1 & gwf_fail~=. & ((F.gwfregimetype==2 & gwfregimetype==1) | (F.gwfregimetype==2 & gwfregimetype==3)) 
replace regimefail = 5 if POL_fail==1 & gwf_fail~=. & (F.regimefail==5 | F2.regimefail==5) & (L.POL_polity2>POL_polity2) & L.gwfregimetype<3 

** Institutional Liberalization
recode regimefail (0=2) if POL_fail==1 & gwf_fail~=1 & gwf_fail~=. & regimefail~=1 & L.POL_polity2<POL_polity2 & (L.POL_polity~=-66 & L.POL_polity~=-77) & (POL_polity~=-66 & POL_polity~=-77) & L.POL_polity~=. & POL_polity~=.
recode regimefail (0=2) if POL_fail==1 & gwf_fail~=1 & gwf_fail~=. & regimefail~=1 & L.POL_polity2==POL_polity2 & (L.POL_polity~=-66 & L.POL_polity~=-77) & (POL_polity~=-66 & POL_polity~=-77) & L.POL_polity~=. & POL_polity~=. & (F.regimefail==2 | F2.regimefail==2 | F3.regimefail==2)
recode regimefail (0=2) if POL_fail==1 & gwf_fail~=1 & gwf_fail~=. & regimefail==0 & POL_polity2>lag_POL_polity2 & lag_POL_polity2~=.
recode regimefail (0=2) if POL_fail==1 & gwf_fail~=1 & gwf_fail~=. & regimefail==0 & POL_polity2>lag2_POL_polity2 & lag2_POL_polity2~=.

** Institutional de-liberalization
recode regimefail (0=4) if POL_fail==1 & gwf_fail~=1 & gwf_fail~=. & L.POL_polity2>POL_polity2 & (L.POL_polity~=-66 & L.POL_polity~=-77) & (POL_polity~=-66 & POL_polity~=-77) & L.POL_polity~=. & POL_polity~=.
recode regimefail (0=4) if POL_fail==1 & gwf_fail~=1 & gwf_fail~=. & L.POL_polity2==POL_polity2 & (L.POL_polity~=-66 & L.POL_polity~=-77) & (POL_polity~=-66 & POL_polity~=-77) & L.POL_polity~=. & POL_polity~=. & (F.regimefail==4 | F2.regimefail==4 | F3.regimefail==4)
recode regimefail (0=4) if POL_fail==1 & gwf_fail~=1 & gwf_fail~=. & regimefail==0 & POL_polity2<lag_POL_polity2 & lag_POL_polity2~=.
recode regimefail (0=4) if POL_fail==1 & gwf_fail~=1 & gwf_fail~=. & regimefail==0 & lead_POL_polity2<lag2_POL_polity2 & lag2_POL_polity2~=.
recode regimefail (0=4) if POL_fail==1 & gwf_fail~=1 & gwf_fail~=. & regimefail==0 & lead2_POL_polity2<POL_polity2 & lead2_POL_polity2~=.

** Durable failures that occur in countries not included in the GWF data set
recode regimefail (0=-88) if POL_fail==1 & gwf_fail==.
** Durable failures that result when a regime remains in power but merges with another country
bysort cowcode (year): replace regimefail = -88 if F.gwf_fail==. & L.gwf_fail~=.
** Durable failures that occur in a transition from interruption or interregnum **
recode regimefail (0=-88) if POL_fail==1 & (lag_POL_polity==-66 | lag_POL_polity==-77)
 
 
** Cases where Polity and GWF code the same event of regime transition (e.g., December election and January inauguration or December step-down and January election)
** In these cases, we follow the GWF coding rule to avoid multiple counts of regime transition that are more frequently observed in Polity. 
* replace regimefail = 0 if cowcode==90  & year==1996  
* replace regimefail = 0 if cowcode==165 & year==1985  
* replace regimefail = 0 if cowcode==452 & year==2001  
* replace regimefail = 0 if cowcode==475 & year==1984  
* replace regimefail = 0 if cowcode==771 & year==1991  
* replace regimefail = 0 if cowcode==771 & year==2009 

** NO CHANGE in POLITY score **
recode POL_fail (1=0) if regimefail==0 & (POL_polity==-88 | POL_polity2==POL_polity) & POL_polity2==lag_POL_polity2 & POL_polity2==lag2_POL_polity2 & POL_polity2==lead_POL_polity2 & POL_polity2==lead2_POL_polity2
recode POL_fail (1=0) if regimefail==0 & (POL_polity2==POL_polity) & POL_polity2==lag_POL_polity2 &  lag2_POL_polity2==. & POL_polity2==lead_POL_polity2 &  POL_polity2==lead2_POL_polity2

label define Fail_Type 1 "Democratic transitions" 2 "Institutional liberalization" 3 "Autocratic transitions" 4 "Institutional deliberalization" 5 "Democratic failure" 
label values regimefail Fail_Type
tab regimefail 
tab gwfregimefail

gen graphgwfpolity = .
replace graphgwfpolity = 165 in 1  /* Durable: Democratic Transitions */
replace graphgwfpolity = 129 in 2  /* GWF: Democratic Transition */
replace graphgwfpolity = . in 3  
replace graphgwfpolity = 154 in 4  /* Durable: Institutional Liberalization */
replace graphgwfpolity = . in 5  
replace graphgwfpolity = 99 in 6  /* Durable: Autocratic Transitions */
replace graphgwfpolity = 111 in 7  /* GWF: Autocratic Transitions */
replace graphgwfpolity = . in 8  
replace graphgwfpolity = 101 in 9  /* Durable: Institutional Deliberalization */
replace graphgwfpolity = . in 10  
replace graphgwfpolity = 60  in 11  /* Durable: Democratic Failure */
replace graphgwfpolity = 79  in 12  /* GWF: Democratic Failure */
gen index = _n in 1/12
label define allfails 1 "Autocracy -" 2 "  Democracy" /*
*/ 3 " "  4 "Institutional liberalization" 5 " " 6 "Autocracy -" 7 "  Autocracy" /*
*/ 8 " " 9 "Institutional de-liberalization" 10 " " 11 "Democracy -" 12 "  Autocracy"
label values index allfails

twoway (bar graphgwfpolity index if index~=2 & index~=7 & index~=12,  scheme(lean2) ) /*
*/  (scatter graphgwfpolity index if index~=2 & index~=7 & index~=12,   ms(none) mla(graphgwfpolity) mlabpos(6))/*
*/ (bar graphgwfpolity index if index==2 | index==7 | index==12, ylabel(0(60)180,glcolor(gs14)) /*
*/ xlabel(1(1)12, valuelabel labsize(vsmall) labcolor(black) labgap(tiny) noticks) xsize(7) ysize(4) /*
*/  graphregion(color(white)) xtitle("Type of event",height(8)) ytitle("Number of country-years")  xscale(range (0 12)) ) /*
*/ (scatter graphgwfpolity index if index==2 | index==7 | index==12, ms(none) mla(graphgwfpolity) mlabpos(6) /*
*/    legend(pos(12) col(4) ring(1) label(1 "Polity durable failure") label(2 "") /*
*/ label(3 "GWF regime transition") label(4 "") bmargin(0)) )
*graph export "C:\Users\jwright\Documents\My Dropbox\Research\Autocratic Instability\DurableGWF.pdf", as(pdf)                            replace

******************************************
**********Morrison Replication************
******************************************

gen poldv = politydv
gen nt = l.nontaxtotalpc/1000
logit poldv nt gdpgrowth l.lnincome d.urbanpop elf  l.lnpopdens l.pastpolitydv polityage polityageknot1 polityageknot2 if l.polity~=-77 & polity~=-77 & polity2~=-77 & l.polity2~=-77, cluster(bankscode)
gen s = e(sample)

tab regimefail poldv if s
browse cow country year regimefail poldv POL_fail POL_durable POL_polity POL_polity2 lag_*  if s==1 & regimefail~=. & (  (poldv==1 & regimefail<=0) | (poldv==0 & regimefail>0) )

gen demTR= poldv==1 & regimefail==1
replace demTR = 1 if (cow==165 & year==1985) | (cow==255 & year==1990)  /* original has Uruguay 1985 and Germany 1990 as regime fail; these are actual the year post-regime fail, but counted as democratic transition years for comparison */

gen demFAIL = poldv==1 & regimefail==5

gen dictCON =poldv==1 & regimefail==3
replace dictCON = 1 if cow==517 & year==1993  /* This is due to earlier coding error by Polity, which was corrected in a later release;  regime collapse occurs in 1994 when rebels take Kigali */
replace dictCON=1 if cow==580 & (year==1973 | year==1974) /* These are two years prior to an autocratic transition in 1975; maybe an old version of Polity had these as Durable failure years? */

gen instLIB = poldv==1 & regimefail==2

gen instDELIB = poldv==1 & regimefail==4
replace instDELIB=1 if cow==110 & (year>=1978 & year<=1980)  /* This is -88  in the updated polity; Guyana had deliberalization in 1980, according to Polity2; PNC and Burnham were incumbents who won the 1980 election */

saveold temp_Polity, replace

*Replication of Model 2, Table 3
logit poldv nt gdpgrowth l.lnincome d.urbanpop elf  l.lnpopdens l.pastpolitydv polityage polityageknot1 polityageknot2 if l.polity~=-77 & polity~=-77 & polity2~=-77 & l.polity2~=-77, cluster(bankscode)
estimates store m1
lroc, nograph
tab poldv if s

*Model 2, Table 3 (democratic transition)
xi:   logit  demTR nt gdpgrowth l.lnincome d.urbanpop elf  l.lnpopdens l.pastpolitydv polityage polityageknot1 polityageknot2 if l.polity~=-77 & polity~=-77 & polity2~=-77 & l.polity2~=-77  , cluster(bankscode)
estimates store m2
lroc, nograph
tab poldv demTR if e(sample)
 

*Model 2, Table 3 (democratic failure)
xi:   logit demFAIL  nt gdpgrowth l.lnincome d.urbanpop elf  l.lnpopdens l.pastpolitydv polityage polityageknot1 polityageknot2 if l.polity~=-77 & polity~=-77 & polity2~=-77 & l.polity2~=-77  , cluster(bankscode)
estimates store m3
lroc, nograph
tab poldv demFAIL  if e(sample)
 

*Model 2, Table 3 (autocratic transition and consolidation)
xi:   logit dictCON  nt gdpgrowth l.lnincome d.urbanpop elf  l.lnpopdens l.pastpolitydv polityage polityageknot1 polityageknot2 if l.polity~=-77 & polity~=-77 & polity2~=-77 & l.polity2~=-77  , cluster(bankscode)
estimates store m4
lroc, nograph
tab poldv dictCON if e(sample)
 
gen demALL = demTR==1 | instLIB==1   if regimefail~=.  & s==1
gen dictALL = dictCON==1 | instDELIB==1  if regimefail~=.  & s==1

xi:   logit demALL  nt gdpgrowth l.lnincome d.urbanpop elf  l.lnpopdens l.pastpolitydv polityage polityageknot1 polityageknot2 if l.polity~=-77 & polity~=-77 & polity2~=-77 & l.polity2~=-77  , cluster(bankscode)
estimates store m5
lroc, nograph
tab poldv demALL if e(sample)

xi:   logit dictALL  nt gdpgrowth l.lnincome d.urbanpop elf  l.lnpopdens l.pastpolitydv polityage polityageknot1 polityageknot2 if l.polity~=-77 & polity~=-77 & polity2~=-77 & l.polity2~=-77  , cluster(bankscode)
estimates store m6
lroc, nograph
tab poldv dictALL if e(sample)

estout  m1 m2 m3 m4 m5 m6 using Table1.tex, cells(b(star  fmt(%9.3f)) se(par fmt(%9.2f))) stats(ll r2 N) style(tex) replace label starlevels(* 0.10 ** 0.05)
saveold temp, replace


****************
** Sample DVs **
****************

use temp, clear
gen type = ""
replace type = "Dem tr" if demTR==1
replace type = "Dem fail" if demFAIL==1
replace type = "Inst lib" if instLIB==1
replace type = "Inst de-lib" if instDEL==1
replace type = "Aut tr" if dictCON==1

  	* All Durable failures in the sample *
sort country year
browse country year type  if s==1 & poldv==1

	* GWF transitions in sample that are not Durable failures *
sort gwf_case year
browse gwf_case year gwfregimefail   if s==1 & poldv==0 & gwfregimefail>0 & gwfregimefail~=.

  	* All GWF democratic failures when no Polity Durable failure *
browse gwf_case year regimefail gwfregimefail POL_fail POL_polity lag_POL_polity if gwfregimefail==3 & regimefail~=5

  	* All GWF Autocracy to Autocracy transitions when no Polity Durable failure *
browse gwf_case year regimefail gwfregimefail POL_fail POL_polity lag_POL_polity if gwfregimefail==2 & regimefail~=3

*****************
***Simulations***
*****************

use temp, clear
set more off
logit poldv nt gdpgrowth l.lnincome d.urbanpop elf  l.lnpopdens l.pastpolitydv polityage polityageknot1 polityageknot2 if s, cluster(bankscode)
drawnorm b1-b11, n(10000) means(e(b)) cov(e(V))  clear 
gen PROBa=.
gen PROBalow=.
gen PROBahigh=.
gen a =.
gen nt_axis = (_n-1)/50 + 0 if _n<=118
/*We want nt to run from 0 to 2.36, ie from 5pctile to 95pctile*/ 
local a=0
while `a' <= 2.36 {
	gen x_beta  = b1*`a'+b2*3.48+b3*8.06+b4*0.4+b5*0.42+b6*3.95+b7*1.86+b8*28+b9*7819+b10*33139+b11*1
	gen prob = invlogit(x_beta)
	egen probhat=mean(prob)
      _pctile prob, p(2.5,97.5) 
      scalar problow= r(r1) 
      scalar probhigh= r(r2)
 	quietly replace a = `a' 
	quietly replace PROBa =  probhat  if nt_axis==a
	quietly replace PROBalow =  problow  if nt_axis==a
	quietly replace PROBahigh =  probhigh  if nt_axis==a
	drop x_beta prob* probhat* 
	local a = `a' + .02
}
label var nt_axis "Non-tax revenue per capita (rescaled)"
label var PROBa "Replication"
sort nt_axis
save Mrep1, replace


use temp, clear
set more off
logit demTR nt gdpgrowth l.lnincome d.urbanpop elf  l.lnpopdens l.pastpolitydv polityage polityageknot1 polityageknot2 if s, cluster(bankscode)
drawnorm b1-b11, n(10000) means(e(b)) cov(e(V))  clear 
gen PROBd=.
gen PROBdlow=.
gen PROBdhigh=.
gen a =.
gen nt_axis = (_n-1)/50 + 0 if _n<=118
/*We want nt to run from 0 to 2.36, ie from 5pctile to 95pctile*/ 
local a=0
while `a' <= 2.36 {
	gen x_beta  = b1*`a'+b2*3.48+b3*8.06+b4*0.4+b5*0.42+b6*3.95+b7*1.86+b8*28+b9*7819+b10*33139+b11*1
	gen prob = invlogit(x_beta)
	egen probhat=mean(prob)
      _pctile prob, p(2.5,97.5) 
      scalar problow= r(r1) 
      scalar probhigh= r(r2) 
 	quietly replace a = `a' 
	quietly replace PROBd =  probhat  if nt_axis==a
	quietly replace PROBdlow =  problow  if nt_axis==a
	quietly replace PROBdhigh =  probhigh  if nt_axis==a
	drop x_beta prob* probhat* 
	local a = `a' + .02
}
label var nt_axis "Non-tax revenue per capita (rescaled)"
label var PROBd "Dem Transition"
sort nt_axis
save Mrep2, replace


use temp, clear
set more off
logit dictCON nt gdpgrowth l.lnincome d.urbanpop elf  l.lnpopdens l.pastpolitydv polityage polityageknot1 polityageknot2 if s, cluster(bankscode)
drawnorm b1-b11, n(10000) means(e(b)) cov(e(V))  clear 
gen PROBx=.
gen PROBxlow=.
gen PROBxhigh=.
gen a =.
gen nt_axis = (_n-1)/50 + 0 if _n<=118
/*We want nt to run from 0 to 2.36, ie from 5pctile to 95pctile*/ 
local a=0
while `a' <= 2.36 {
	gen x_beta  = b1*`a'+b2*3.48+b3*8.06+b4*0.4+b5*0.42+b6*3.95+b7*1.86+b8*28+b9*7819+b10*33139+b11*1
	gen prob = invlogit(x_beta)
	egen probhat=mean(prob)
      _pctile prob, p(2.5,97.5) 
      scalar problow= r(r1) 
      scalar probhigh= r(r2) 
 	quietly replace a = `a' 
	quietly replace PROBx =  probhat  if nt_axis==a
	quietly replace PROBxlow =  problow  if nt_axis==a
	quietly replace PROBxhigh =  probhigh  if nt_axis==a
	drop x_beta prob* probhat* 
	local a = `a' + .02
}
label var nt_axis "Non-tax revenue per capita (rescaled)"
label var PROBx "Autocratic Trans/Cons"
sort nt_axis
save Mrep3, replace

merge nt_axis using Mrep1
sort nt_axis
drop _merge
merge nt_axis using Mrep2
sort nt_axis
drop _merge
merge using temp
set scheme lean1
label var nt "Non-tax revenue distribution"


twoway  (hist nt if nt<2.4 & s==1 & nt>0, yaxis(2)  lcolor(gs12) bin(100) scheme(lean1)) /*
*/ (line PROBa nt_axis if nt_axis<=2.4, yaxis(1))  /*
*/ (line PROBd nt_axis if nt_axis<=2.4, yaxis(1))  /*
*/ (line PROBx nt_axis if nt_axis<=2.4, yaxis(1))  /*
*/ , yscale(range (0 0.04)) ylabel(0 (.01) 0.04) xtitle("Non-tax revenue per capita (1000's)", size(3.5)) ytitle("Pr(Failure)", size(3.5)) /*
*/ legend(pos(12) col(2) ring(1) label(1 "Non-tax revenue distribution") label(2 "Replication estimate") label(3 "Democratic transition")label(4 "Autocratic transition/consolidation") )
*graph export "C:\Users\jwright\Documents\My Dropbox\Research\Autocratic Instability\MorrisonRep.pdf", as(pdf)                            replace


******************************
** 95% Confidence Intervals **
******************************

twoway  (hist nt if nt<2.4 & s==1 & nt>0, yaxis(2)  lcolor(gs12) bin(100) scheme(lean1)) /*
*/ (line PROBa PROBalow PROBahigh nt_axis if nt_axis<=2.4, clpattern(solid dash dash) yaxis(1) ysc(r(0 0.08)) ylabel(#4)) /*
*/ , yscale(range (0 0.06)) ylabel(0 (.01) 0.06)  xtitle("Non-tax revenue per capita (1000's)", size(4)) ytitle("Pr(Failure)", size(4)) /*
*/ legend(off)
*graph export "C:\Users\jwright\Documents\My Dropbox\Research\Autocratic Instability\MorrisonRep_all95CI.pdf", as(pdf)                            replace

twoway  (hist nt if nt<2.4 & s==1 & nt>0, yaxis(2)  lcolor(gs12) bin(100) scheme(lean1)) /*
*/ (line PROBd PROBdlow PROBdhigh nt_axis if nt_axis<=2.4, clpattern(solid dash dash) yaxis(1) ysc(r(0 0.08)) ylabel(#4))  /*
*/ ,yscale(range (0 0.06)) ylabel(0 (.01) 0.06)  xtitle("Non-tax revenue per capita (1000's)", size(4)) ytitle("Pr(Failure)", size(4)) /*
*/ legend(off)
*graph export "C:\Users\jwright\Documents\My Dropbox\Research\Autocratic Instability\MorrisonRep_dem95CI.pdf", as(pdf)                            replace

twoway  (hist nt if nt<2.4 & s==1 & nt>0, yaxis(2)  lcolor(gs12) bin(100) scheme(lean1)) /*
*/ (line PROBx PROBxlow PROBxhigh nt_axis if nt_axis<=2.4, clpattern(solid dash dash) yaxis(1) ysc(r(0 0.08)) ylabel(#4)) /*
*/ ,yscale(range (0 0.06)) ylabel(0 (.01) 0.06)  xtitle("Non-tax revenue per capita (1000's)", size(4)) ytitle("Pr(Failure)", size(4)) /*
*/ legend(off)
*graph export "C:\Users\jwright\Documents\My Dropbox\Research\Autocratic Instability\MorrisonRep_auto95CI.pdf", as(pdf)                            replace



